package com.bw.jetpacktest.databinding;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;

import com.bw.jetpacktest.R;

import java.util.ArrayList;
import java.util.List;

public class RecyclerViewActivity extends AppCompatActivity {
    private RvAdapter adapter = new RvAdapter();
    private List<String>list = new ArrayList<>();
    private ActivityRvBinding binding;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this, R.layout.activity_rv);
        binding.setAdapter(adapter);
        for (int i = 0;i < 100;i ++){
            list.add("item:"+i);
        }
        adapter.setNewInstance(list);
    }
}
